Skip to content

Implementation of Direct Scale Transform Feature#1434

Open
dhunstack wants to merge 7 commits into
MTG:masterfrom
dhunstack:dirsctrans
Open

Implementation of Direct Scale Transform Feature#1434
dhunstack wants to merge 7 commits into
MTG:masterfrom
dhunstack:dirsctrans

Conversation

@dhunstack
Copy link
Copy Markdown
Contributor

[feat] Complete Implementation of Direct Scale Transform

  • Added parameters in header file
  • Added configure function
  • Added first order difference and matrix multiplication code

[feat] Add tests for Direct Scale Transform
Add the following tests:

  • Invalid Parameters Test
  • Invalid Inputs Test
  • Zero Input Test
  • Regression Test to compare with original Python implementation

- Added parameters in header file
- Added configure function
- Added first order difference and matrix multiplication code

Signed-off-by: Anmol Mishra <anmolmishra1997@gmail.com>
Add the following tests:
 - Invalid Parameters Test
 - Invalid Inputs Test
 - Zero Input Test
 - Regression Test to compare with original Python implementation

Signed-off-by: Anmol Mishra <anmolmishra1997@gmail.com>
@dbogdanov
Copy link
Copy Markdown
Member

Let's replace the .txt files with .npy binaries for numerical data in tests.

#include "directscaletransform.h"
#include "essentiamath.h"

#define FOR(i,l,r) for(int i=l; i<r; i++)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's avoid using this define for clarify.

"This code was derived from the original DST paper:\n"
"[1] Williams, W. J., and E. J. Zalubas. Helicopter transmission fault detection via "
"time-frequency, scale and spectral methods. Mechanical systems and signal processing"
"14.4 (2000): 545-559.");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some reference implementation we could additionally cite here?

std::complex<Real> zi = std::complex<Real>(0, 1);
Real step = M_PI/log(N+1);
int num_rows = _C/step+1; // Number of rows. +1 because need to include the first row which is the 0th multiple of step
int P = matrix[0].size();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no guarantee on the consistency of the size of inner vectors, because we are using vector of vectors. Therefore, this should be checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants